/**
 * Created with JetBrains WebStorm.
 * User: Steven
 * Date: 25-4-13
 * Time: 22:01
 * To change this template use File | Settings | File Templates.
 */

function Specialization(name)
{
    this.id = -1; // Unique Specialization ID
    this.name = name;
    this.skillModifiers = {};
}

Specialization.prototype.addSkillModifier = function(skillType, value)
{
    this.skillModifiers[skillType] = value;
};

Specialization.prototype.getSkillModifier = function(skillType)
{
    return skillType in this.skillModifiers ? this.skillModifiers[skillType] : 0;
};

Specialization.prototype.hasSkillModifier = function(skillType)
{
    return skillType in this.skillModifiers;
};

Specialization.specializations = [];

Specialization.specializations.push(CombatSpecialization);
CombatSpecialization.prototype = new Specialization("Combat");
CombatSpecialization.prototype.constructor = Specialization;
function CombatSpecialization()
{
    this.id = 0;
    this.addSkillModifier(SkillTypes.blade, 5);
    this.addSkillModifier(SkillTypes.blunt, 5);
    this.addSkillModifier(SkillTypes.handtohand, 5);
    this.addSkillModifier(SkillTypes.athletics, 5);
    this.addSkillModifier(SkillTypes.armorer, 5);
    this.addSkillModifier(SkillTypes.block, 5);
    this.addSkillModifier(SkillTypes.heavyarmor, 5);
}

Specialization.specializations.push(MagicSpecialization);
MagicSpecialization.prototype = new Specialization("Magic");
MagicSpecialization.prototype.constructor = Specialization;
function MagicSpecialization()
{
    this.id = 1;
    this.addSkillModifier(SkillTypes.alchemy, 5);
    this.addSkillModifier(SkillTypes.conjuration, 5);
    this.addSkillModifier(SkillTypes.mysticism, 5);
    this.addSkillModifier(SkillTypes.alteration, 5);
    this.addSkillModifier(SkillTypes.destruction, 5);
    this.addSkillModifier(SkillTypes.restoration, 5);
    this.addSkillModifier(SkillTypes.illusion, 5);
}

Specialization.specializations.push(StealthSpecialization);
StealthSpecialization.prototype = new Specialization("Stealth");
StealthSpecialization.prototype.constructor = Specialization;
function StealthSpecialization()
{
    this.id = 2;
    this.addSkillModifier(SkillTypes.marksmanship, 5);
    this.addSkillModifier(SkillTypes.security, 5);
    this.addSkillModifier(SkillTypes.sneak, 5);
    this.addSkillModifier(SkillTypes.acrobatics, 5);
    this.addSkillModifier(SkillTypes.lightarmor, 5);
    this.addSkillModifier(SkillTypes.mercantile, 5);
    this.addSkillModifier(SkillTypes.speechcraft, 5);
}
